Adds a search or searches to the grid.

<div class="definition">
    addSearch([before], search)
</div>

<div class="arguments">
    <table>
    <tr>
        <td>before</td>
        <td><b>string</b> or <b>integer</b>, <i>optional</i>, search to add before</td>
    </tr>
    <tr>
        <td>search</td>
        <td><b>object</b> or <b>array</b>, search(s) to add</td>
    </tr>
    </table>
</div>
Returns integer.

<h4>Description</h4>

Adds a search or searches to the grid by adding items into <a class="property" href="w2grid.searches">.searches</a> array. Since the
search popup is shown when user clicks the search button, there is no need to refresh the grid. The first optional argument
<span class="argument">before</span> is the search to insert before. It can be either a search field name or the index in
the <a class="property" href="w2grid.searches">.searches</a> array. If first parameter is not defined, the search will be appended
to the end. Second argument <span class="argument">search</span> is the search object or an array of search objects.
<div style="height: 10px"></div>

Returns the number of searches it adds.
<div style="height: 10px"></div>

If you define grid as:
<textarea class="javascript">
let grid = new w2grid({
    name    : 'grid',
    columns: [
        { field: 'recid', text: 'ID', size: '50px' },
        { field: 'lname', text: 'Last Name', size: '30%', searchable: true },
        { field: 'fname', text: 'First Name', size: '30%', searchable: true },
        { field: 'email', text: 'Email', size: '40%', searchable: true },
        { field: 'sdate', text: 'End Date', size: '120px' }
    ],
    records: [
        { recid: 1, fname: 'John', lname: 'doe', email: 'vitali@gmail.com', sdate: '1/3/2012' },
        { recid: 2, fname: 'Stuart', lname: 'Motzart', email: 'jdoe@gmail.com', sdate: '2/4/2012' }
    ]
});
</textarea>

You can add searches by:
<textarea class="javascript">
grid.addSearch({ field: 'recid', text: 'ID', type: 'int' });
</textarea>

or several at a time:

<textarea class="javascript">
grid.addSearch([
    { field: 'fname', text: 'First Name', type: 'text' },
    { field: 'lname', text: 'Last Name', type: 'text' }
]);
</textarea>

See <a class="property" href="w2grid.searches">.searches</a> array for the structure of the search object.